// https://github.com/v8/v8/wiki/Stack%20Trace%20API
var stackReg = /at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i;
var stackReg2 = /at\s+()(.*):(\d*):(\d*)/i;

    data = {};
	if (true) {
		// get call stack, and analyze it
		// get all file,method and line number
		var stacklist = (new Error()).stack.split('\n').slice(3);
        console.log(stacklist);
		var s = stacklist[0] || stacklist[0];
        console.log('----------', s);
		var sp = stackReg.exec(s) || stackReg2.exec(s);
		if (sp && sp.length === 5) {
			data.method = sp[1];
			data.path = sp[2];
			data.line = sp[3];
			data.pos = sp[4];
			data.file = __filename;
			data.stack = stacklist.join('\n');
		}
	}

    console.log(data);
